namespace OasisCiq.Xml
{
    using System.Xml;
    using Xal;
    using Xnal;
    using Xnl;
    using Xpil;

    public class CiqXmlWriter
    {
        private readonly XalXmlWriter xalWriter;
        private readonly XnalXmlWriter xnalWriter;
        private readonly XnlXmlWriter xnlWriter;
        private readonly XpilXmlWriter xpilWriter;

        public CiqXmlWriter(XmlWriter writer)
        {
            xalWriter = new XalXmlWriter(writer);
            xnalWriter = new XnalXmlWriter(writer);
            xnlWriter = new XnlXmlWriter(writer);
            xpilWriter = new XpilXmlWriter(writer);
        }

        public void Write(NameLine element)
        {
            xnlWriter.WriteNameLine(element);
        }

        public void Write(PartyNameType element)
        {
            xnlWriter.WritePartyName(element);
        }

        public void Write(PersonNameType element)
        {
            xnlWriter.WritePersonName(element);
        }

        public void Write(OrganisationNameType element)
        {
            xnlWriter.WriteOrganisationName(element);
        }

        public void Write(AddressType element)
        {
            xalWriter.WriteAddress(element);
        }

        public void Write(Record element)
        {
            xnalWriter.WriteRecord(element);
        }

        public void Write(PostalLabel element)
        {
            xnalWriter.WritePostalLabel(element);
        }

        public void Write(OrganisationDetailsType element)
        {
            xpilWriter.WriteOrganisationDetails(element);
        }

        public void Write(PartyType element)
        {
            xpilWriter.WriteParty(element);
        }

        public void Write(PersonDetailsType element)
        {
            xpilWriter.WritePersonDetails(element);
        }
    }
}